package cn.intotw.rdcj.goods.fallback;
import cn.intotw.rdcj.core.bean.CommonErrors;
import cn.intotw.rdcj.core.bean.Result;
import cn.intotw.rdcj.goods.api.RdcjGoodsApi;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class RdcjGoodsFallbackFactory implements FallbackFactory<RdcjGoodsApi> {
    private static Result exceptionCaught(Throwable throwable){
        return new Result(CommonErrors.SERVICE_UNAVAILABLE.getCode(), "fallback cause = " + throwable.getMessage());
    }

    @Override
    public RdcjGoodsApi create(Throwable throwable) {
        return null;
    }
}